package com.orhon.smartcampus.modules.systemctl.mm;


import java.util.List;

import org.mapstruct.InheritConfiguration;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

import com.orhon.smartcampus.modules.base.mm.DictionaryMapper;
import com.orhon.smartcampus.modules.base.mm.LangMapper;
import com.orhon.smartcampus.modules.systemctl.entity.Operations;
import com.orhon.smartcampus.modules.systemctl.gqlModel.GQLOperation;

@Mapper(
        uses = {
                LangMapper.class,
                ModuleMapper.class,
                DictionaryMapper.class,
                MenuMapper.class,
                WidgetsMapper.class
        }
)
public interface OperationMapper {

    OperationMapper MAPPER = Mappers.getMapper(OperationMapper.class);

    @Mapping(source ="id" , target = "id")
    @Mapping(source ="title" , target = "title")//lang
    @Mapping(source ="createdAt" , target = "created_at")
    @Mapping(source ="updatedAt" , target = "updated_at")
    @Mapping(source ="deletedAt" , target = "deleted_at") 
    @Mapping(target = "module" , ignore = true)
    @Mapping(target = "menus" , ignore = true)
    @Mapping(target = "widgets" , ignore = true)
    GQLOperation toOperations(Operations moduleentity);

    @InheritConfiguration(name = "toOperations")
    List<GQLOperation> toOperationsList(List<Operations> entities);

}
